<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Document   : Credit
    Created on : Dec 22, 2008, 3:51:34 PM
    Author     : Administrator
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <script language="JavaScript">

var time = 10000; // 10 secs
var steps = 50; // Five per second
var step = 1;

function progress() {
var bar = document.getElementById( "barwrap");
var aStep = (bar.offsetWidth -2) /steps;// 2px border removed from width
var x = Math.round( aStep *step);
var outer = document.getElementById( "outer");
var inner = document.getElementById( "inner");

// Work out seconds based on % progress from current step
var secs = (( time /1000) -Math.floor( ( step /steps) *10));

inner.style.width = x +"px";
step++;

// If 0 seconds, display waiting message instead
outer.firstChild.innerHTML = ( secs? secs +" seconds...": "Click the button to credit the advertisement...");
if(secs == 0){
    inner.firstChild.innerHTML = "0 oldu";
   document.getElementByID("credit").setAttribute("visible", "false");
}

if(!(step > steps))
    setTimeout( "progress();", time /steps);
    ////redir();
//else

}
</script>
    <f:view>
        <webuijsf:page id="page1">
            <webuijsf:html id="html1">
                <webuijsf:head id="head1">
                    <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
                </webuijsf:head>
                <webuijsf:body id="body1" onLoad="javascript:progress()" style="background-color: rgb(255, 204, 102); -rave-layout: grid">
                    <div id="wrap">
                Progress:
                <div id="barwrap"></div>
                        <!-- P wrappers for text positioning -->
                        <div id="outer">
                            <p></p>
                        </div>
                        <!-- original colour/text -->
                        <div id="inner">
                            <p></p>
                        </div>
                        <!-- new colour/text -->
                    </div>
                    <webuijsf:form id="form1">
                        <webuijsf:button actionExpression="#{Credit.credit_action}" binding="#{Credit.credit}" id="credit"
                            style="height: 24px; left: 216px; top: 24px; position: absolute; width: 119px" text="Click to Credit the Ad"/>
                    </webuijsf:form>
                </webuijsf:body>
            </webuijsf:html>
        </webuijsf:page>
    </f:view>
</jsp:root>
